﻿using System;
using System.Web.Mvc;

namespace EasyUIMvc
{
    public class MenuButtonExtension : ExtensionBase
    {
        private readonly MenuButtonSettings _settings;

        public MenuButtonExtension(MenuButtonSettings settings)
        {
            _settings = settings;
        }

        public override string GetScripts()
        {
            throw new NotImplementedException();
        }
        public override MvcHtmlString GetHtml()
        {
            var menubutton = GetTopTag("a", "easyui-menubutton", _settings);
            menubutton.MergeAttribute("href", "javascript:void(0)");
            menubutton.SetInnerText(_settings.Text);
            return MvcHtmlString.Create(menubutton.ToString());
        }
    }
    public class MenuButtonSettings : SettingsBase 
    {
        public string Text { get; set; }
    }
}
